Optimal. Leaf size=73 \[ -\frac {2 \sqrt {a-b} \sqrt {a+b} \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}+\frac {a x}{b^2}-\frac {\sin (c+d x)}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3024, 2735, 2659, 205} \[ -\frac {2 \sqrt {a-b} \sqrt {a+b} \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}+\frac {a x}{b^2}-\frac {\sin (c+d x)}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 2659
Rule 2735
Rule 3024
Rubi steps
\begin {align*} \int \frac {1-\cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx &=-\frac {\sin (c+d x)}{b d}+\frac {\int \frac {b+a \cos (c+d x)}{a+b \cos (c+d x)} \, dx}{b}\\ &=\frac {a x}{b^2}-\frac {\sin (c+d x)}{b d}-\frac {\left (a^2-b^2\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{b^2}\\ &=\frac {a x}{b^2}-\frac {\sin (c+d x)}{b d}-\frac {\left (2 \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^2 d}\\ &=\frac {a x}{b^2}-\frac {2 \sqrt {a-b} \sqrt {a+b} \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}-\frac {\sin (c+d x)}{b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.14, size = 69, normalized size = 0.95 \[ \frac {-2 \sqrt {b^2-a^2} \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b^2-a^2}}\right )+a (c+d x)-b \sin (c+d x)}{b^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 202, normalized size = 2.77 \[ \left [\frac {2 \, a d x - 2 \, b \sin \left (d x + c\right ) + \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right )}{2 \, b^{2} d}, \frac {a d x - b \sin \left (d x + c\right ) - \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right )}{b^{2} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.39, size = 122, normalized size = 1.67 \[ \frac {\frac {{\left (d x + c\right )} a}{b^{2}} + \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} \sqrt {a^{2} - b^{2}}}{b^{2}} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} b}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.07, size = 145, normalized size = 1.99 \[ -\frac {2 a^{2} \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \,b^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {2 \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d b \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a}{d \,b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.56, size = 112, normalized size = 1.53 \[ \frac {2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}}{b^2\,d}-\frac {\sin \left (c+d\,x\right )}{b\,d}+\frac {2\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b^2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 125.90, size = 1039, normalized size = 14.23 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________